﻿/**
 * 進入房間命令
 * 
 * @author LuoDong
 * @email luo4521@online.net.tw
 * 2010-2-7 10:03
 */
package com.addcn.texas.control {
	import com.addcn.fog.control.ICommand;
	import com.addcn.fog.control.SimpleCommand;
	
	import com.addcn.texas.model.*;		
	import com.addcn.common.utils.DestroyMemory;
	
	public class RegGameModelCommand extends SimpleCommand implements ICommand {
		
		public override function execute(r_data:Object = null):void {		
			//注冊房間數據模型
			if (!modelLocator.hasModel(RoomModel)) {
				modelLocator.addModel(RoomModel); 																		
			}	
			//注冊房間中玩家數據模型	
			if (!modelLocator.hasModel(RoomUserModel)) {
				modelLocator.addModel(RoomUserModel); 			
			}
			//注冊游戏數據模型				
			if (!modelLocator.hasModel(GameInfoModel)) {
				modelLocator.addModel(GameInfoModel);												
			}
			//移除大厅数据模型	
			modelLocator.removeModel(HallModel); 
			modelLocator.removeModel(UserInfoModel);
			DestroyMemory.clear();
			
		}

	}
}
